import request from '@/utils/request'

// 受试者
const api = {
    list: '/boss/project/manage/listPts',
    // centerList: '/boss/project/team/listRes',
    centerList: '/boss/project/manage/listResearch',
    addPts: '/boss/project/manage/addPts',
    subjectExport: '/boss/project/manage/subjectExport',
    PtsDetails: '/boss/project/manage/getPtsDetails', // 受试者详细信息
    doctorList: '/boss/project/manage/listDoctor', // 显示当前项目研究人员
    upDatePtsStatus: '/boss/project/manage/updatePtsStatus', // 修改当前状态
    updatePtsReId: '/boss/project/manage/updatePtsReId', // 研究人员修改或添加
    updatePtsAuth: '/boss/project/manage/updatePtsAuth', // 受试者审批
    delPts: '/boss/project/manage/delPts', // 取消
    addPtsTable: '/boss/project/manage/addPtsTable', // 上传
    listInterView: '/boss/project/manage/listInterview',
    visitDetail: '/boss/project/manage/listVisit',
    reinviteSubject: '/boss/project/manage/anewInvitePts' // 重新邀请受试者
}

export function getaAddPtsTable (parameter) {
    return request({
        url: api.addPtsTable,
        method: 'post',
        data: parameter,
        headers: { 'Content-Type': 'multipart/form-data' }
    })
}

export function list (parameter) {
    return request({
        url: api.list,
        method: 'post',
        data: parameter
    })
}

export function centerList (parameter) {
    return request({
        url: api.centerList,
        method: 'post',
        data: parameter
    })
}

export function addPts (parameter) {
    return request({
        url: api.addPts,
        method: 'post',
        data: parameter
    })
}

export function getSubjectExport (parameter) {
    return request({
        url: api.subjectExport,
        method: 'get',
        params: parameter,
        responseType: 'blob'
    })
}

export function PtsDetails (parameter) {
    return request({
        url: api.PtsDetails,
        method: 'post',
        data: parameter
    })
}

export function doctorList (parameter) {
    return request({
        url: api.doctorList,
        method: 'post',
        data: parameter
    })
}

export function upDatePtsStatus (parameter) {
    return request({
        url: api.upDatePtsStatus,
        method: 'post',
        data: parameter
    })
}

export function updatePtsReId (parameter) {
    return request({
        url: api.updatePtsReId,
        method: 'post',
        data: parameter
    })
}

export function updatePtsAuth (parameter) {
    return request({
        url: api.updatePtsAuth,
        method: 'post',
        data: parameter
    })
}

export function delPts (parameter) {
    return request({
        url: api.delPts,
        method: 'post',
        data: parameter
    })
}
export function getListInterView (parameter) {
    return request({
        url: api.listInterView,
        method: 'post',
        data: parameter
    })
}
export function getVisitDetail (parameter) {
    return request({
        url: api.visitDetail,
        method: 'post',
        data: parameter
    })
}
// 重新邀请受试者
export function reinviteSubject (parameter) {
    return request({
        url: api.reinviteSubject,
        method: 'post',
        data: parameter
    })
}
